# lib.outBase

- **Type:** `string`
- **Default Value:** `undefined`

:::info

`outBase` is a specific configuration for [bundleless mode](/guide/basic/output-structure#bundle--bundleless). This configuration does not take effect in bundle mode because all output files are bundled into a single file, so there's no need to determine the base output directory.

:::

When building a project where source files exist across multiple directories with bundleless mode, the output directory structure will be replicated relative to the `outBase` directory in the output directory. If no base output directory is specified, the [lowest common ancestor](https://en.wikipedia.org/wiki/Lowest_common_ancestor) of all input entry points is used by default.

Configuring `outBase` will change the path of the base output directory. `outBase` can be either a relative path from the current process directory or an absolute path.

For example, we have the following directory structure:

```txt
.
├── package.json
├── rslib.config.ts
└── src
    └── utils
        ├── bar
        │   └── index.ts
        ├── foo
        │   └── index.ts
        └── index.ts
```

If the output base directory is not specified, the lowest common ancestor of all input entry point paths, i.e. `./src/utils`, is used by default, and the final file output structure is:

```txt
dist
├── bar
│   └── index.js
├── foo
│   └── index.js
└── index.js
```

When `outBase` is configured as `./src`, the output directory structure is:

```txt
dist
└── utils
    ├── bar
    │   └── index.js
    ├── foo
    │   └── index.js
    └── index.js
```

::: tip

When the project needs to generate declaration files, to ensure that the generated declaration files and JS files maintain a consistent output directory structure, if you modify the `outBase` configuration, you need to make sure that the [rootDir](https://www.typescriptlang.org/tsconfig/rootDir.html) in `tsconfig.json` is set to the same path.

:::
